<?php

include_once ($GLOBALS['cfgPaths']['lib'].'util/Dir.php');

class TemplateUtil {
	
	var $tplCmsPath;
	
	function TemplateUtil () {
		$this->tplCmsPath = $GLOBALS['cfgPaths']['template'].'cms';
	}
	
	/**
	 * static
	 */
	function getMediaFormats ($contenttpl) {
        $d = new Dir($this->tplCmsPath.'/content');
        $mediatypes = array('html');
        while ($dirname = $d->read()) {
            if (preg_match("/^".str_replace('', '', $contenttpl)."\.(.+)/", $dirname, $matches)) {
                $mediatypes[] = $matches[1];
            }
        }
        $d->close();
        return $mediatypes;
	}
	
}

?>